The following piece of code was submitted by Dave
MacRae, and is said to checkthe expiry date of
your credit card, if you pass the date the user
entered to the subroutine like:
&CheckExpire($FORM{'cardexp'});
Just put the following subroutine into the
script,
as well as a call similar to the one above.
sub CheckExpire {
local ($exp_date) = @_;
$exp_date =~ s/ //g;
($month, $year) = split('/', $exp_date);
(@thistime) = gmtime(time);
$thistime[4]++;
$date = "\"$thistime[5]/$thistime[4]/$thistime[3]:";
if (length($month) > 2 or length($year) > 2) {
return 0;
} elsif ($month 12) {
return 0;
} elsif ($year